package exception;

public class TryCatchDemo2 {
    public static void main(String[] args) {
        System.out.println("Hello World");
        try {
            String str = null;
            System.out.println(str.length());
            String str1 = "abc";
            System.out.println(str1.charAt(5));
        }catch (NullPointerException|StringIndexOutOfBoundsException e){
            System.out.println("出现了空指针或下标越界");
        }catch (Exception e){
            System.out.println("出错啦!!!!!!!!!!!!!!!!!!");
        }

    }
}
